<template>
	<view class="nextpage">
		
	</view>
</template>

<script>
	import {login} from '../../utils/api.js'
	export default {
		data() {
			return {
				
			}
		},
	
			 onLoad(e) {
			uni.showToast({
				title:e.code,
				icon:'none',
				duration: 10000
			});
				 if(e.code){
				 let p={
				 	code:e.code
				 	 }
				 	login(p).then(res=>{
						console.log(res,'这是登录')
				  	uni.setStorageSync('token',res.data.token)
					if(res.data.member.isPromoter===null&&res.data.member.isMember===null){
						uni.redirectTo({
						url:'/pages/banner/banner'
						})
					}else {
					  uni.switchTab({
					  url:'/pages/center/center'
					  })
					}
					
								
				})
				  
				
	}
			
				  
	},
		methods: {
			
		},
		 onUnload() {
		    uni.hideLoading();
		  },
		  onHide() {
		   uni.hideLoading();
		  }
	}
</script>

<style lang="less">
    .nextpage{
		
	}
</style>
